package main

import (
	"fmt"

	"svr/src/conf"
	"svr/src/db"
	_ "svr/src/internal/cmd"
	"svr/src/logs"
	"svr/src/ws"

	"time"
	// "google.golang.org/protobuf/proto"
)

func main() {
	fmt.Println("------start server--------", time.Now())
	err := conf.LoadConfigFile("config_single.json")
	if err != nil {
		logs.Debugf("LoadConfigFile error :", err)
		return
	}
	conf.Test()

	/**/
	if db.InitRedis() == nil {
		logs.Errorf("redis is not open!!!!")
		return
	} else {
		logs.Debugf("redis inited succeed !!!!")
	}
	if db.InitMySql() == nil {
		logs.Errorf("mysql is not open!!!!")
		return
	} else {
		logs.Debugf("mysql inited succeed !!!!")
	}
	/**/
	ws.StartSever()
}
